<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,user-scale=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
    <title>查询</title>
    <!-- head 中 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">

    <link rel="stylesheet" href="./Public/css/index.css">
    <link rel="stylesheet" href="./Public/css/sign.css">
</head>
<body>
<div class="container">
    <div class="top">
    </div>
    <div class="field-list" style="margin-top: 10px;">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">邮箱</label></div>
            <div class="weui-cell__bd">
                <input id="mailAddress" class="weui-input" placeholder="请于10分钟后查询结果"/>
            </div>
        </div>
    </div>
    <div class="field-list item">
        <div class="field-item">
            <div class="weui-cell__hd">
                <label class="weui-label">企业<img src="./Public/img/icon-down.png" alt="" width="14"></label>
            </div>
            <div class="weui-cell__bd">
                <input class="input-box full_name" placeholder="企业全称"/>
                <input class="type" value="1" type="hidden"/>
            </div>
        </div>
        <div class=" field-item">
            <div class="weui-cell__hd"><label class="weui-label"></label></div>
            <div class="weui-cell__bd">
                <input class=" input-box code" style="border-bottom:none;" placeholder="组织机构代码"/>
            </div>
        </div>
    </div>
    <div class="field-list item">
        <div class="field-item">
            <div class="weui-cell__hd"><label class="weui-label">企业<img src="./Public/img/icon-down.png" alt="" width="14"></label></div>
            <div class="weui-cell__bd">
                <input class="input-box full_name" placeholder="企业全称"/>
                <input class="type" value="1" type="hidden"/>
            </div>
        </div>
        <div class=" field-item">
            <div class="weui-cell__hd"><label class="weui-label"></label></div>
            <div class="weui-cell__bd">
                <input class=" input-box code" style="border-bottom:none;" placeholder="组织机构代码"/>
            </div>
        </div>
    </div>
    <div class="field-list item">
        <div class="field-item">
            <div class="weui-cell__hd"><label class="weui-label">个人<img src="./Public/img/icon-down.png" alt="" width="14"></label></div>
            <div class="weui-cell__bd">
                <input class="input-box full_name" placeholder="姓名"/>
                <input class="type" value="2" type="hidden"/>
            </div>
        </div>
        <div class=" field-item">
            <div class="weui-cell__hd"><label class="weui-label"></label></div>
            <div class="weui-cell__bd">
                <input class=" input-box code" style="border-bottom:none;" placeholder="身份证号"/>

            </div>
        </div>
    </div>

    <div class="weui-form__opr-area">
        <button class="weui-btn add-list" style="width: 120px">+添加列表</button>
    </div>

    <div class="bottom">
        <div class="btn ghost" id="continue_upload" style="margin-bottom: 16px;">调整查询设置</div>
        <input type="button" id="submit" class="btn primary" style="font-size: 14px;" value="提交">
    </div>
</div>
</body>
<!-- body 最后 -->
<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="./Public/js/public/login.js"></script>
<script src="./Public/js/layer/layer.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>

<!-- 如果使用了某些拓展插件还需要额外的JS -->
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/swiper.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/city-picker.min.js"></script>
<script>
    var _queryUrl   =   'http://jdwzcx.livingbang.com/jdwzcx/investigate';
    var _token      =   $.cookie('token');
    var _queryList  =   [];
    var _mailAddress=   $('#mailAddress').val();
    $('#submit').click(function () {
        var _items  =   $('.item');
        for (var i = 0; i < _items.length; i++) {
            var _full_name  =   _items[i].getElementsByClassName('full_name')[0];
            var _type  =   _items[i].getElementsByClassName('type')[0];
            var _code  =   _items[i].getElementsByClassName('code')[0];

            var _queryItem  =   {
                name:_full_name.value,
                cardNumber:_code.value,
                type:_type == '1' ? '法人':'自然人',
            };
            _queryList.push(_queryItem);
        }
        console.log(_queryList);
        $.ajax({
            //请求方式
            type : "POST",
            //请求的媒体类型
            contentType: "application/json;charset=UTF-8",
            //请求地址
            url : _queryUrl,
            //数据，json字符串
            data : {
                token:_token,
                queryList:_queryList,
                mailAddress:_mailAddress
            },
            //请求成功
            success : function(result) {
                console.log(result);
            },
            //请求失败，包含具体的错误信息
            error : function(e){
                console.log(e.status);
                console.log(e.responseText);
            }
        });
    });
</script>
</html>